@isTest
private class SummaryStageWinRatioToOppHandlerTest {
    static testMethod void testMethod1() {
    	Province__c pro = TestUtils.createProvince();
        insert pro;

        City__c c = TestUtils.createCity();
        c.Province__c = pro.Id;
        insert c;

        District__c d = TestUtils.createDistrict();
        d.City__c = c.Id;
        insert d;

        // 客户
        Account acc = TestUtils.createAccount();
        acc.Status__c = '审核通过';
        acc.RecordTypeId = Utils.getRecordTypeIdByDevNameAndObjName('终端客户', 'Account');
        insert acc;

        // 业务机会
        Opportunity opp = TestUtils.createOpportunity();
        opp.AccountId = acc.Id;
        opp.StageCanChange__c = '意向';
        opp.StageName = '意向';
        opp.Department__c = '';
        insert opp;

        StageWinRate__c sw = new StageWinRate__c();
        sw.Name=opp.StageName;
        sw.Opportunity__c=opp.Id;
        insert sw;
    }
}